package com.ego.dubbo.service.impl;

import com.ego.dubbo.service.ManagerrDubboService;
import com.ego.mapper.ManagerMapper;
import com.ego.pojo.Manager;
import com.ego.pojo.ManagerExample;
import org.apache.dubbo.config.annotation.DubboService;

import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;


/**
 * @Title
 * @Author Lyg
 * @Description:
 */
@DubboService
public class ManagerrDubboServiceImpl implements ManagerrDubboService {
    @Autowired
    private ManagerMapper managerMapper;
    @Override
    public Manager selectManagerrByUsername(String username) {
        ManagerExample managerExample = new ManagerExample();

        managerExample.createCriteria().andUsernameEqualTo(username);

        List<Manager> list=managerMapper.selectByExample(managerExample);

        if (list!=null&&list.size()>0){
            return list.get(0);
        }
        return null;
    }
}
